///renew renew just to test 
using namespace std;
#include <cmath>
#include "QuickSort.h"
#define PI (std::atan(1.0) * 4.0)
#define E (std::exp(1))

  int main(int argc, char *argv[])
  {

	  clock_t start, end;
	  const double CLOCKS_PER_MILLISECOND = ((clock_t)1);
	  //test 1: 当测试vector含有小于10个元素时，使用插入排序。
	  vector<double> A;
	  A.push_back(PI);
	  A.push_back(PI);
	  A.push_back(E);
	  A.push_back(0);
	  A.push_back(1);

	  std::cout << "Before sort: A = [";
	  for (int i = 0; i < A.size(); i++)
		  std::cout << A[i] << ", ";
	  std::cout << "\b\b]" << std::endl;
	  start = clock();
	  sort(A);
	  end = clock();
	  std::cout << "After sort: A = [";
	  for (int i = 0; i < A.size(); i++)
		  std::cout << A[i] << ", ";
	  std::cout << "\b\b]" << std::endl<<std::endl;
	  std::cout << "The run time of sort of A is: " << (double)(end - start) / CLOCKS_PER_MILLISECOND << "  ms" << endl << endl;

	  //test 2 : 当测试vector含有大于10个元素时，使用快排。
	  vector<double> B;
	  B.push_back(PI);
	  B.push_back(PI);
	  B .push_back(E);
	  B.push_back(0);
	  B.push_back(1);
	  B.push_back(100);
	  B.push_back(10);
	  B.push_back(99);
	  B.push_back(20);
	  B.push_back(30);
	  B.push_back(50);
	  B.push_back(20);
	  B.push_back(90);
	  B.push_back(E);
	  B.push_back(1000);
	  B.push_back(PI);
	  B.push_back(PI);
	  B.push_back(E);
	  B.push_back(0);
	  B.push_back(1);
	  B.push_back(100);
	  B.push_back(10);
	  B.push_back(99);
	  B.push_back(20);
	  B.push_back(30);
	  B.push_back(50);
	  B.push_back(20);
	  B.push_back(90);
	  B.push_back(E);
	  B.push_back(1000);
	  B.push_back(PI);
	  B.push_back(PI);
	  B.push_back(E);
	  B.push_back(0);
	  B.push_back(1);
	  B.push_back(100);
	  B.push_back(10);
	  B.push_back(99);
	  B.push_back(20);
	  B.push_back(30);
	  B.push_back(50);
	  B.push_back(20);
	  B.push_back(90);
	  B.push_back(E);
	  B.push_back(1000);
	  B.push_back(PI);
	  B.push_back(PI);
	  B.push_back(E);
	  B.push_back(0);
	  B.push_back(1);
	  B.push_back(100);
	  B.push_back(10);
	  B.push_back(99);
	  B.push_back(20);
	  B.push_back(30);
	  B.push_back(50);
	  B.push_back(20);
	  B.push_back(90);
	  B.push_back(E);
	  B.push_back(1000);

	  std::cout << "Before sort: B = [";
	  for (int i = 0; i < B.size(); i++)
		  std::cout << B[i] << ", ";
	  std::cout << "\b\b]" << std::endl;
	  start = clock();
	  sort(B);
	  end = clock();
	  std::cout << "After sort: B = [";
	  for (int i = 0; i < B.size(); i++)
		  std::cout << B[i] << ", ";
	  std::cout << "\b\b]" << std::endl;
	  std::cout << "The run time of quicksort of B is: " << (double)(end - start) / CLOCKS_PER_MILLISECOND << "  ms" << endl << endl;


	  return 0;
  };
